using System;
using UnityEngine;

namespace HCP
{
	public static class Extensions
	{
		public static T EnsureComponent<T>(this GameObject g) where T : Component
		{
			T t = g.GetComponent<T>();
			if (t == null)
			{
				t = g.AddComponent<T>();
			}
			return t;
		}
	}
}
